//
//  MovieViewController.m
//  LoLBox
//
//  Created by lanou3g on 15/5/31.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "MovieViewController.h"

@interface MovieViewController ()

@property (nonatomic , strong) MPMoviePlayerController * moviePlayer;//播放控制器
@end

@implementation MovieViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
//     [self layout];
//    
//    self.moviePlayer.contentURL = [NSURL URLWithString:_url];
//    
//    NSLog(@"%@",_url);
//    
//    [self.moviePlayer play];
    
    
    
    
    UIWebView * web = [[UIWebView alloc]initWithFrame:self.view.bounds];
    
    NSURLRequest * request = [[NSURLRequest alloc]initWithURL:[NSURL URLWithString:_url] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0
                              ];
    UIBarButtonItem * left = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemReply target:self action:@selector(back)];
    
    self.navigationItem.leftBarButtonItem = left;
    
    [web loadRequest:request];
    
    [self.view addSubview:web];
    
}

-(void)back

{
    
    [self.navigationController popViewControllerAnimated:YES];
    
}




-(void)layout
{
    self.moviePlayer = [[MPMoviePlayerController alloc]init];
    
    self.moviePlayer.view.frame = self.view.bounds;
    
    [self.view addSubview:self.moviePlayer.view];
    
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
